package com.antler.mobilesniffer;

import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.antler.utils.MyLog;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    protected static final String TAG = "[ANTLER]" + MainActivity.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button btnStartService = (Button) findViewById(R.id.btn_start_service);
        btnStartService.setOnClickListener(this);

        Button btnStopService = (Button) findViewById(R.id.btn_stop_service);
        btnStopService.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_start_service: {
                Intent intent = new Intent(this, MainService.class);
                startService(intent);
            }
            break;
            case R.id.btn_stop_service: {
                Intent intent = new Intent(this, MainService.class);
                stopService(intent);
            }
            break;
        }
    }
}
